package com.example.springboot2022nocv.controller;

import com.example.springboot2022nocv.entity.NocvGlobalData;
import com.example.springboot2022nocv.service.GlobalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author 程序员小洋
 * @version 2022.3
 * @date 2022/12/23 19:08
 * @title
 */
@SuppressWarnings("all")
@Controller
public class GlobalController {

    @Autowired
    private GlobalService globalService;

    /**
     * 跳转到全球疫情页面
     */
    @RequestMapping("/toGlobal")
    public String toGlobal(){
        return "global";
    }

    @RequestMapping("/queryGlobal")
    @ResponseBody
    public List<NocvGlobalData> queryGlobal(){
        List<NocvGlobalData> list = globalService.list();
        return list;
    }

    /**
     * 跳转全国新增趋势图
     */
    @RequestMapping("/trend/toIncrease")
    public String toIncrease(){
        return "trendIncrease";
    }
}
